package com.wt.chat.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class Message {
    private Integer id;

    private Integer dialogId;

    private Short type;

    private Byte sender;

    private String content;

    private Integer status;

	@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private Date createTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getDialogId() {
        return dialogId;
    }

    public void setDialogId(Integer dialogId) {
        this.dialogId = dialogId;
    }

    public Short getType() {
        return type;
    }

    public void setType(Short type) {
        this.type = type;
    }

	public Byte getSender() {
		return sender;
	}

	public Message setSender(Byte sender) {
		this.sender = sender;
		return this;
	}

	public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

	public Integer getStatus() {
		return status;
	}

	public Message setStatus(Integer status) {
		this.status = status;
		return this;
	}

	public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public enum SenderType {
		/**
		 * 消息发送方
		 */
		KEFU((byte)1),
		USER((byte)0);
    	private byte value;

		SenderType(byte value) {
			this.value = value;
		}

		public byte getValue() {
			return value;
		}
	}

	public enum MsgType {
		/**
		 * 消息类型
		 */
		TEXT((short)0),
		FILE((short)1);
		private short value;

		MsgType(short value) {
			this.value = value;
		}

		public short getValue() {
			return value;
		}
	}

	public enum MsgStatus {
		/**
		 * 消息类型
		 */
		READ(1),
		UNREAD(0);
		private int value;

		MsgStatus(int value) {
			this.value = value;
		}

		public int getValue() {
			return value;
		}
	}
}